<template>
  <div class="pay-transfer-container">
    <!-- 搜索区域 -->
    <ContentWrap class="search-wrapper">
      <!-- 搜索头部 -->
      <div class="search-header">
        <div class="header-icon">
          <Icon icon="ep:coin" />
        </div>
        <div class="header-content">
          <h3 class="search-title">转账订单管理</h3>
          <p class="search-subtitle">查看和管理所有转账订单信息</p>
        </div>
      </div>

      <!-- 搜索表单 -->
      <div class="search-form-container">
        <el-form
          :model="queryParams"
          ref="queryFormRef"
          :inline="true"
          label-width="100px"
          label-position="left"
          class="enhanced-search-form"
        >
          <div class="form-grid">
            <el-form-item label="转账单号" prop="no" class="form-item">
              <el-input
                v-model="queryParams.no"
                placeholder="请输入转账单号"
                clearable
                @keyup.enter="handleQuery"
                class="enhanced-input"
              >
                <template #prefix>
                  <Icon icon="ep:document" />
                </template>
              </el-input>
            </el-form-item>

            <el-form-item label="转账渠道" prop="channelCode" class="form-item">
              <el-select
                v-model="queryParams.channelCode"
                placeholder="请选择支付渠道"
                clearable
                class="enhanced-select"
              >
                <template #prefix>
                  <Icon icon="ep:credit-card" />
                </template>
                <el-option
                  v-for="dict in getStrDictOptions(DICT_TYPE.PAY_CHANNEL_CODE)"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>

            <el-form-item label="商户单号" prop="merchantTransferId" class="form-item">
              <el-input
                v-model="queryParams.merchantTransferId"
                placeholder="请输入商户单号"
                clearable
                @keyup.enter="handleQuery"
                class="enhanced-input"
              >
                <template #prefix>
                  <Icon icon="ep:document" />
                </template>
              </el-input>
            </el-form-item>

            <el-form-item label="类型" prop="type" class="form-item">
              <el-select
                v-model="queryParams.type"
                placeholder="请选择类型"
                clearable
                class="enhanced-select"
              >
                <template #prefix>
                  <Icon icon="ep:collection-tag" />
                </template>
                <el-option
                  v-for="dict in getStrDictOptions(DICT_TYPE.PAY_TRANSFER_TYPE)"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>

            <el-form-item label="转账状态" prop="status" class="form-item">
              <el-select
                v-model="queryParams.status"
                placeholder="请选择转账状态"
                clearable
                class="enhanced-select"
              >
                <template #prefix>
                  <Icon icon="ep:switch" />
                </template>
                <el-option
                  v-for="dict in getStrDictOptions(DICT_TYPE.PAY_TRANSFER_STATUS)"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>

            <el-form-item label="收款人姓名" prop="userName" class="form-item">
              <el-input
                v-model="queryParams.userName"
                placeholder="请输入收款人姓名"
                clearable
                @keyup.enter="handleQuery"
                class="enhanced-input"
              >
                <template #prefix>
                  <Icon icon="ep:user" />
                </template>
              </el-input>
            </el-form-item>

            <el-form-item label="渠道单号" prop="channelTransferNo" class="form-item">
              <el-input
                v-model="queryParams.channelTransferNo"
                placeholder="渠道单号"
                clearable
                @keyup.enter="handleQuery"
                class="enhanced-input"
              >
                <template #prefix>
                  <Icon icon="ep:link" />
                </template>
              </el-input>
            </el-form-item>

            <el-form-item label="创建时间" prop="createTime" class="form-item">
              <el-date-picker
                v-model="queryParams.createTime"
                value-format="YYYY-MM-DD HH:mm:ss"
                type="daterange"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
                class="enhanced-date-picker"
              />
            </el-form-item>
          </div>

          <div class="form-actions">
            <el-button @click="handleQuery" class="search-btn">
              <Icon icon="ep:search" class="btn-icon" />
              搜索
            </el-button>
            <el-button @click="resetQuery" class="reset-btn">
              <Icon icon="ep:refresh" class="btn-icon" />
              重置
            </el-button>
          </div>
        </el-form>
      </div>
    </ContentWrap>

    <!-- 列表 -->
    <ContentWrap class="table-wrapper">
      <!-- 表格头部 -->
      <div class="table-header">
        <div class="header-icon">
          <Icon icon="ep:list" />
        </div>
        <div class="header-content">
          <h4 class="table-title">转账列表</h4>
          <p class="table-subtitle">共 {{ total }} 条转账记录</p>
        </div>
      </div>

      <!-- 表格容器 -->
      <div class="table-container">
        <el-table
          v-loading="loading"
          :data="list"
          :stripe="true"
          :show-overflow-tooltip="true"
          border
          class="enhanced-table"
          :header-cell-style="{ background: '#f8f9ff', color: '#303133', fontWeight: '600' }"
        >
          <el-table-column label="编号" align="center" prop="id" width="80">
            <template #default="scope">
              <div class="id-cell">
                <Icon icon="ep:key" class="id-icon" />
                <span class="id-text">{{ scope.row.id }}</span>
              </div>
            </template>
          </el-table-column>

          <el-table-column
            label="创建时间"
            align="center"
            prop="createTime"
            :formatter="dateFormatter"
            width="180px"
          >
            <template #default="scope">
              <div class="time-cell">
                <Icon icon="ep:clock" class="time-icon" />
                <span>{{ dateFormatter(scope.row, null, scope.row.createTime) }}</span>
              </div>
            </template>
          </el-table-column>

          <el-table-column label="应用编号" align="center" prop="appId" width="120">
            <template #default="scope">
              <div class="app-cell">
                <Icon icon="ep:document" class="app-icon" />
                <span>{{ scope.row.appId }}</span>
              </div>
            </template>
          </el-table-column>

          <el-table-column label="类型" align="center" prop="type" width="120">
            <template #default="scope">
              <div class="type-cell">
                <dict-tag
                  :type="DICT_TYPE.PAY_TRANSFER_TYPE"
                  :value="scope.row.type"
                  class="enhanced-dict-tag"
                />
              </div>
            </template>
          </el-table-column>

          <el-table-column label="转账金额" align="center" prop="price" width="120">
            <template #default="scope">
              <div class="price-cell">
                <Icon icon="ep:coin" class="price-icon" />
                <span class="price-text">￥{{ (scope.row.price / 100.0).toFixed(2) }}</span>
              </div>
            </template>
          </el-table-column>

          <el-table-column label="转账状态" align="center" prop="status" width="120">
            <template #default="scope">
              <div class="status-cell">
                <dict-tag
                  :type="DICT_TYPE.PAY_TRANSFER_STATUS"
                  :value="scope.row.status"
                  class="enhanced-dict-tag"
                />
              </div>
            </template>
          </el-table-column>

          <el-table-column label="订单号" align="left" width="300">
            <template #default="scope">
              <div class="order-numbers">
                <p class="transfer-font merchant-order">
                  <el-tag size="small" class="order-tag merchant-tag">商户</el-tag>
                  <span class="order-number">{{ scope.row.merchantTransferId }}</span>
                </p>
                <p class="transfer-font transfer-order" v-if="scope.row.no">
                  <el-tag size="small" type="warning" class="order-tag transfer-tag">转账</el-tag>
                  <span class="order-number">{{ scope.row.no }}</span>
                </p>
                <p class="transfer-font channel-order" v-if="scope.row.channelTransferNo">
                  <el-tag size="small" type="success" class="order-tag channel-tag">渠道</el-tag>
                  <span class="order-number">{{ scope.row.channelTransferNo }}</span>
                </p>
              </div>
            </template>
          </el-table-column>

          <el-table-column label="收款人姓名" align="center" prop="userName" width="120">
            <template #default="scope">
              <div class="user-cell">
                <Icon icon="ep:user" class="user-icon" />
                <span>{{ scope.row.userName || '-' }}</span>
              </div>
            </template>
          </el-table-column>

          <el-table-column label="收款账号" align="left" width="200">
            <template #default="scope">
              <div class="account-info">
                <p class="transfer-font alipay-account" v-if="scope.row.alipayLogonId">
                  <el-tag size="small" class="account-tag alipay-tag">支付宝登录号</el-tag>
                  <span class="account-number">{{ scope.row.alipayLogonId }}</span>
                </p>
                <p class="transfer-font wechat-account" v-if="scope.row.openid">
                  <el-tag size="small" class="account-tag wechat-tag">微信 openId</el-tag>
                  <span class="account-number">{{ scope.row.openid }}</span>
                </p>
                <span v-if="!scope.row.alipayLogonId && !scope.row.openid" class="no-account"
                  >-</span
                >
              </div>
            </template>
          </el-table-column>

          <el-table-column label="转账标题" align="center" prop="subject" width="120">
            <template #default="scope">
              <div class="subject-cell">
                <Icon icon="ep:document" class="subject-icon" />
                <el-tooltip :content="scope.row.subject" placement="top">
                  <span class="subject-text">{{ scope.row.subject || '-' }}</span>
                </el-tooltip>
              </div>
            </template>
          </el-table-column>

          <el-table-column label="转账渠道" align="center" prop="channelCode" width="120">
            <template #default="scope">
              <div class="channel-cell">
                <dict-tag
                  :type="DICT_TYPE.PAY_CHANNEL_CODE"
                  :value="scope.row.channelCode"
                  class="enhanced-dict-tag"
                />
              </div>
            </template>
          </el-table-column>

          <el-table-column
            label="转账成功时间"
            align="center"
            prop="successTime"
            :formatter="dateFormatter"
            width="180px"
          >
            <template #default="scope">
              <div class="success-time-cell">
                <Icon icon="ep:check" class="success-icon" />
                <span>{{ dateFormatter(scope.row, null, scope.row.successTime) || '-' }}</span>
              </div>
            </template>
          </el-table-column>

          <el-table-column label="操作" align="center" fixed="right" width="100">
            <template #default="scope">
              <div class="action-buttons">
                <el-button link type="primary" @click="openDetail(scope.row.id)" class="detail-btn">
                  <Icon icon="ep:view" class="btn-icon" />
                  详情
                </el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>

      <!-- 分页 -->
      <div class="pagination-wrapper">
        <Pagination
          :total="total"
          v-model:page="queryParams.pageNo"
          v-model:limit="queryParams.pageSize"
          @pagination="getList"
        />
      </div>

      <TransferDetail ref="detailRef" />
    </ContentWrap>
  </div>
</template>

<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import * as TransferApi from '@/api/pay/transfer'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import TransferDetail from './TransferDetail.vue'
defineOptions({ name: 'PayTransfer' })

const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化

const loading = ref(true) // 列表的加载中
const total = ref(0) // 列表的总页数
const list = ref([]) // 列表的数据
const queryParams = reactive({
  pageNo: 1,
  pageSize: 10,
  no: null,
  appId: null,
  channelId: null,
  channelCode: null,
  merchantTransferId: null,
  type: null,
  status: null,
  successTime: [],
  price: null,
  subject: null,
  userName: null,
  alipayLogonId: null,
  openid: null,
  createTime: []
})
const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中

/** 查询列表 */
const getList = async () => {
  loading.value = true
  try {
    const data = await TransferApi.getTransferPage(queryParams)
    list.value = data.list
    total.value = data.total
  } finally {
    loading.value = false
  }
}

/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.pageNo = 1
  getList()
}

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value.resetFields()
  handleQuery()
}

/** 添加/修改操作 */
const detailRef = ref()
const openDetail = (id: number) => {
  detailRef.value.open(id)
}

/** 初始化 **/
onMounted(() => {
  getList()
})
</script>

<style lang="scss" scoped>
// 主题色变量
$primary-color: #0052cc;
$primary-light: rgba(0, 82, 204, 0.1);
$primary-border: rgba(0, 82, 204, 0.3);
$success-color: #67c23a;
$warning-color: #e6a23c;
$danger-color: #f56c6c;
$info-color: #909399;
$text-primary: #303133;
$text-regular: #606266;
$text-secondary: #909399;
$text-placeholder: #c0c4cc;
$border-color: #dcdfe6;
$border-light: #e4e7ed;
$bg-color: #f5f7fa;
$shadow-light: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
$shadow-base:
  0 2px 4px rgba(0, 0, 0, 0.12),
  0 0 6px rgba(0, 0, 0, 0.04);
$border-radius: 12px;
$border-radius-small: 8px;

.pay-transfer-container {
  padding: 16px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;

  @media (max-width: 768px) {
    padding: 8px;
  }
}

/* 搜索区域样式 */
.search-wrapper {
  margin-bottom: 16px;
  border-radius: $border-radius;
  overflow: hidden;
  box-shadow: $shadow-light;
  border: 1px solid $border-light;

  :deep(.el-card__body) {
    padding: 0;
  }
}

.search-header {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, $primary-color 0%, #1d4ed8 100%);
  color: white;
  border-bottom: 1px solid $border-light;

  @media (max-width: 768px) {
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

.header-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: $border-radius-small;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;

  @media (max-width: 768px) {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

.header-content {
  flex: 1;
  margin-left: 16px;

  @media (max-width: 768px) {
    margin-left: 0;
  }
}

.search-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px 0;

  @media (max-width: 768px) {
    font-size: 18px;
  }
}

.search-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;

  @media (max-width: 768px) {
    font-size: 12px;
  }
}

.search-form-container {
  background: white;
  padding: 24px;

  @media (max-width: 768px) {
    padding: 16px;
  }
}

.enhanced-search-form {
  .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;

    @media (max-width: 768px) {
      grid-template-columns: 1fr;
      gap: 16px;
    }
  }

  .form-item {
    margin-bottom: 0;

    :deep(.el-form-item__label) {
      font-weight: 500;
      color: $text-regular;
    }
  }
}

.enhanced-input,
.enhanced-select,
.enhanced-date-picker {
  width: 100%;

  :deep(.el-input__wrapper) {
    border-radius: $border-radius-small;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;

    &:hover {
      box-shadow: 0 4px 12px rgba(0, 82, 204, 0.1);
    }

    &.is-focus {
      box-shadow: 0 4px 12px rgba(0, 82, 204, 0.2);
    }
  }
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;

  @media (max-width: 768px) {
    flex-direction: column;
  }
}

.search-btn {
  background: linear-gradient(135deg, $primary-color 0%, #1d4ed8 100%);
  border: none;
  border-radius: $border-radius-small;
  padding: 10px 20px;
  font-weight: 500;
  color: white;
  transition: all 0.3s ease;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
  }

  @media (max-width: 768px) {
    width: 100%;
  }

  .btn-icon {
    margin-right: 6px;
  }
}

.reset-btn {
  border: 2px solid $border-color;
  color: $text-regular;
  border-radius: $border-radius-small;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.3s ease;

  &:hover {
    border-color: $primary-color;
    color: $primary-color;
    background: $primary-light;
  }

  @media (max-width: 768px) {
    width: 100%;
  }

  .btn-icon {
    margin-right: 6px;
  }
}

/* 表格区域样式 */
.table-wrapper {
  border-radius: $border-radius;
  overflow: hidden;
  box-shadow: $shadow-light;
  border: 1px solid $border-light;

  :deep(.el-card__body) {
    padding: 0;
  }
}

.table-header {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
  border-bottom: 1px solid $border-light;

  @media (max-width: 768px) {
    padding: 16px;
  }

  .header-icon {
    width: 40px;
    height: 40px;
    background: $primary-color;
    border-radius: $border-radius-small;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;

    @media (max-width: 768px) {
      width: 36px;
      height: 36px;
      font-size: 16px;
    }
  }

  .header-content {
    flex: 1;
    margin-left: 12px;

    @media (max-width: 768px) {
      margin-left: 10px;
    }
  }

  .table-title {
    font-size: 16px;
    font-weight: 600;
    color: $text-primary;
    margin: 0 0 2px 0;

    @media (max-width: 768px) {
      font-size: 14px;
    }
  }

  .table-subtitle {
    font-size: 13px;
    color: $text-secondary;
    margin: 0;

    @media (max-width: 768px) {
      font-size: 12px;
    }
  }
}

.table-container {
  background: white;
  overflow-x: auto;
}

.enhanced-table {
  :deep(.el-table__header) {
    th {
      background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%) !important;
      color: $text-primary !important;
      font-weight: 600 !important;
      border-bottom: 2px solid $primary-light;
      padding: 16px 12px;
    }
  }

  :deep(.el-table__body) {
    tr {
      transition: all 0.3s ease;

      &:hover {
        background: $primary-light !important;
      }

      td {
        padding: 14px 12px;
        border-bottom: 1px solid $border-light;
      }
    }

    .el-table__row--striped {
      background: #fafbff;

      &:hover {
        background: $primary-light !important;
      }
    }
  }

  // H5适配
  @media (max-width: 768px) {
    :deep(.el-table__header) th {
      padding: 12px 8px;
      font-size: 13px;
    }

    :deep(.el-table__body) td {
      padding: 12px 8px;
      font-size: 12px;
    }
  }
}

/* 表格单元格样式 */
.id-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.id-icon {
  color: $primary-color;
  font-size: 14px;
  flex-shrink: 0;
}

.id-text {
  font-weight: 500;
  color: $text-primary;
  font-family: 'Courier New', monospace;
}

.time-cell,
.success-time-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 12px;
  color: $text-secondary;
}

.time-icon,
.success-icon {
  color: $text-secondary;
  font-size: 14px;
}

.success-icon {
  color: $success-color;
}

.app-cell,
.user-cell,
.subject-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.app-icon,
.user-icon,
.subject-icon {
  color: $primary-color;
  font-size: 14px;
  flex-shrink: 0;
}

.subject-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  color: $text-regular;
  max-width: 100px;
}

.type-cell,
.status-cell,
.channel-cell {
  display: flex;
  justify-content: center;
  align-items: center;
}

.enhanced-dict-tag {
  border-radius: 6px;
  font-weight: 500;
  padding: 4px 8px;
  font-size: 12px;

  @media (max-width: 768px) {
    font-size: 11px;
    padding: 3px 6px;
  }
}

.price-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-weight: 600;
}

.price-icon {
  color: $warning-color;
  font-size: 14px;
}

.price-text {
  color: $warning-color;
  font-weight: 600;
}

.order-numbers {
  padding: 8px;
  background: rgba(0, 82, 204, 0.05);
  border-left: 3px solid $primary-color;
  border-radius: 4px;
}

.transfer-font {
  padding: 4px 0;
  font-size: 12px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;

  @media (max-width: 768px) {
    font-size: 11px;
    gap: 6px;
  }
}

.order-tag {
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;

  @media (max-width: 768px) {
    font-size: 9px;
    padding: 1px 4px;
  }
}

.merchant-tag {
  background: $primary-light;
  color: $primary-color;
  border: 1px solid $primary-border;
}

.transfer-tag {
  background: rgba(230, 162, 60, 0.1);
  color: $warning-color;
  border: 1px solid rgba(230, 162, 60, 0.3);
}

.channel-tag {
  background: rgba(103, 194, 58, 0.1);
  color: $success-color;
  border: 1px solid rgba(103, 194, 58, 0.3);
}

.order-number {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: $text-regular;
  word-break: break-all;
  flex: 1;

  @media (max-width: 768px) {
    font-size: 10px;
  }
}

.account-info {
  padding: 8px;
  background: rgba(103, 194, 58, 0.05);
  border-left: 3px solid $success-color;
  border-radius: 4px;
}

.account-tag {
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;

  @media (max-width: 768px) {
    font-size: 9px;
    padding: 1px 4px;
  }

  &.alipay-tag {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
  }

  &.wechat-tag {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
  }
}

.account-number {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: $text-regular;
  word-break: break-all;
  flex: 1;

  @media (max-width: 768px) {
    font-size: 10px;
  }
}

.no-account {
  color: $text-placeholder;
  font-style: italic;
  font-size: 12px;
}

.action-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.detail-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;

  &:hover {
    background: $primary-light;
    transform: scale(1.05);
  }

  .btn-icon {
    font-size: 12px;
  }

  @media (max-width: 768px) {
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* 分页样式 */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px 24px;
  background: white;
  border-top: 1px solid $border-light;

  @media (max-width: 768px) {
    padding: 16px;
  }

  :deep(.el-pagination) {
    .el-pager li {
      border-radius: 6px;
      margin: 0 2px;
      transition: all 0.3s ease;

      &:hover {
        background: $primary-light;
        color: $primary-color;
      }

      &.is-active {
        background: $primary-color;
        color: white;
      }
    }

    .btn-prev,
    .btn-next {
      border-radius: 6px;
      transition: all 0.3s ease;

      &:hover {
        background: $primary-light;
        color: $primary-color;
      }
    }

    @media (max-width: 768px) {
      .el-pagination__sizes,
      .el-pagination__jump {
        display: none;
      }
    }
  }
}

/* 响应式优化 */
@media (max-width: 480px) {
  .pay-transfer-container {
    padding: 4px;
  }

  .search-form-container {
    padding: 12px;
  }

  .form-actions {
    gap: 8px;

    .el-button {
      padding: 8px 12px;
      font-size: 13px;
    }
  }

  .enhanced-table {
    :deep(.el-table__header) th {
      padding: 10px 6px;
      font-size: 12px;
    }

    :deep(.el-table__body) td {
      padding: 10px 6px;
      font-size: 11px;
    }
  }

  .pagination-wrapper {
    padding: 12px;
  }
}

/* 加载状态优化 */
:deep(.el-loading-mask) {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);

  .el-loading-spinner {
    .path {
      stroke: $primary-color;
    }
  }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .pay-transfer-container {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  }

  .search-wrapper,
  .table-wrapper {
    background: #374151;
    border-color: #4b5563;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .search-form-container,
  .table-container,
  .pagination-wrapper {
    background: #374151;
  }

  .table-header {
    background: #4b5563;
    border-color: #6b7280;
  }

  .search-title,
  .table-title {
    color: #f9fafb;
  }

  .id-text {
    color: #f9fafb;
  }

  .order-number,
  .account-number {
    color: #d1d5db;
  }

  .subject-text {
    color: #d1d5db;
  }

  .enhanced-table {
    :deep(.el-table__header) {
      th {
        background: #4b5563 !important;
        color: #f9fafb !important;
        border-bottom-color: #6b7280;
      }
    }

    :deep(.el-table__cell) {
      border-bottom-color: #4b5563;
    }
  }

  .merchant-tag {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
  }

  .order-numbers {
    background: rgba(96, 165, 250, 0.1);
    border-color: #60a5fa;
  }

  .account-info {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
  }

  .account-tag {
    &.alipay-tag {
      background: rgba(59, 130, 246, 0.1);
      color: #3b82f6;
      border-color: rgba(59, 130, 246, 0.3);
    }

    &.wechat-tag {
      background: rgba(34, 197, 94, 0.1);
      color: #22c55e;
      border-color: rgba(34, 197, 94, 0.3);
    }
  }
}
</style>
